package com.googlecode.archimedes.filegen.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * <p>
 * Model element for Tabs
 * </p>
 * 
 * <p>Created: Jun 11, 2005</p>
 * 
 * @author Erik Gustavson
 * @version $Id: Tab.java 443 2005-06-13 03:56:59 +0000 (Mon, 13 Jun 2005) erik $
 */
public class Tab extends AbstractAsset {

    private List<Entity> entities   = new ArrayList<Entity>();
    private List<String> entityRefs = new ArrayList<String>();
    private String       name       = null;

    /** 
     * @see com.tps.filegen.model.Asset#getSubordinateAssets()
     */
    public Collection<? extends Asset> getSubordinateAssets() {
        return this.getEntities();
    }

    /**
     * Adds an entity to this tab
     * @param entity
     */
    public void addEntity(Entity entity) {
        this.getEntities().add(entity);
    }

    /**
     * Adds an entity reference to this tab. Entity references are just the names
     * of entities.
     * 
     * @param entityRef
     */
    public void addEntityRef(String entityRef) {
        this.getEntityRefs().add(entityRef);
    }

    /**
     * Returns the entities.
     *
     * @return List<Entity> value of entities
     */
    public List<Entity> getEntities() {
        return entities;
    }

    /**
     * Sets the entities
     * @param entities The entities to set.
     */
    public void setEntities(List<Entity> entities) {
        this.entities = entities;
    }

    /**
     * Returns the entityRefs.
     *
     * @return List<String> value of entityRefs
     */
    public List<String> getEntityRefs() {
        return entityRefs;
    }

    /**
     * Sets the entityRefs
     * @param entityRefs The entityRefs to set.
     */
    public void setEntityRefs(List<String> entityRefs) {
        this.entityRefs = entityRefs;
    }

    /**
     * Returns the name.
     *
     * @return String value of name
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the name
     * @param name The name to set.
     */
    public void setName(String name) {
        this.name = name;
    }
}
